package org.kernely.security.ui.user.mgmt;

import org.kernely.ui.mvp.IKernelyView;

import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;

/**
 * View to edit roles of a user.
 */
public class EditUserRoleView extends VerticalLayout implements IKernelyView{

	/**
	 * The Serial Version ID
	 */
	private static final long serialVersionUID = -6523319493621770083L;
	
	/**
	 * Panel containing the roles list
	 */
	private Panel roleLayout;

	/**
	 * EditUserRoleView's constructor
	 */
	public EditUserRoleView(){
		this.roleLayout = new Panel();
		
		this.roleLayout.setSizeFull();
		this.roleLayout.setHeight(400, Sizeable.UNITS_PIXELS );
		this.roleLayout.setScrollable(true);
		this.roleLayout.setStyleName(Panel.STYLE_LIGHT);
		this.addComponent(roleLayout);
		
		this.setSizeFull();
		// Window's size
		this.setComponentAlignment(roleLayout, Alignment.MIDDLE_RIGHT);
		this.setWidth(270, Sizeable.UNITS_PIXELS);
		this.setHeight(400, Sizeable.UNITS_PIXELS);
	}

	/**
	 * @return the roleLayout
	 */
	public final Panel getRoleLayout() {
		return roleLayout;
	}

	/**
	 * @see org.kernely.ui.mvp.IKernelyView#getComponent()
	 */
	public final Component getComponent() {
		return this;
	}

}
